<?php
namespace Module\Manage;

use Module\Manage\Init;
use Model\Visit as ModelVisit;
/**
 * 微信访问日志
 * @author shooke
 *
 */
class Visit extends Init
{
    /**
     * 访问日志概况
     */
    public function index()
    {
        $dateline = strtotime(date('Y-m-d'))-(24*3600*7);
        
        $v = ModelVisit::where("dateline>$dateline")->field("year",'day',"count(id)")->group('day')->page(2)->fetchAll();
        
       
        $vd = [
            'visit'=>$v,
            'pagestring'=>ModelVisit::pageString()
        ];
        
        view($vd);
    }
    /**
     * 访问日志详情
     */
    public function record()
    {
        
        $vd = [
            'visit'=>ModelVisit::page(10)->order('id desc')->fetchAll(),
            'pagestring'=>ModelVisit::pageString()
        ];
        view($vd);
    }
}